#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back

using namespace std;

using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;
using ll = long long;
using db = double;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 5010;

int n,a[N];
ll tot[N],k,x;

void solve() {
	n = in; k = in,x = in; for(int i = 1;i <= n;i++) a[i] = in; sort(a + 1,a + n + 1,greater<int>());
	tot[n + 1] = 0;
	for(int i = n;i >= 1;i--) tot[i] = tot[i + 1] + a[i];
	ll ans = tot[1];
	for(int i = 2;i <= 2 * k;i += 2) {
		ans = min(ans,i / 2 * x + tot[i + 1]);
	}
	printf("%lld\n",ans); 
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    for(int T = in;T;T--) solve(); return 0;
}
